<!--
+----------------------------------------------------------------------
| 友得云客  - 开启房产营销新纪元
+----------------------------------------------------------------------
| Copyright (c) 2019~2023 优得（西安）信息科技有限公司版权所有
+----------------------------------------------------------------------
| Licensed 友得云客不是自由软件 未经允许不可移除相关版权
+----------------------------------------------------------------------
| Author: www.youdeyunke.com
+----------------------------------------------------------------------
-->
<template>
    <div class="nav-item" v-cloak>
        <div class="icon">
            <img class="img" :src="nav.iconUrl + '?imageView2/5/h/100/w/100'"
                :style="{ width: nav.size + '%', height: nav.size + '%' }" />
            <div class="inner-text" v-if="nav.dynamicInnerText" v-show="nav.innerText">X</div>    
            <div class="inner-text" v-else v-show="nav.innerText">{{ nav.innerText }}</div>
            <div class="badge-text" v-show="nav.badgeText"><span>{{ nav.badgeText }}</span></div>
        </div>
        <div class="name" :style="{ color: nav.color || '#333333' }">
            {{ nav.name }}
        </div>
    </div>
</template>

<script>
export default {
    data () {
        return {
            loading: false,
        };
    },
    props: {
        nav: { type: Object, default: null }
    },

    mounted: function () {
    },

    computed: {
    },

    methods: {
    }
};
</script>

<style scoped>
.nav-item {
    width: 100%;
    height: 100%;
}

.name {
    font-size: 24px;
    color: #333;
    text-align: center;
    width: 100px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: hidden;
}


.icon {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon .img {}

.icon .inner-text {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 10;
    top: 0;
    left: 0;
    font-size: 24px;
    color: #fff;
    font-weight: bold;
    text-align: center;
    line-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}


.icon .badge-text {
    background: #F43535;
    color: #fff;
    border-radius: 16px;
    position: absolute;
    top: -20px;
    padding: 6px 16px;
    right: -20px;
    max-width: 240px;
    height: 72px;
    line-height: 72rpx;

    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-align: center;
}

.icon .badge-text {
    transform: scale(0.5);
}
</style>